home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Dec 90 / MacApp.Tech$ 12⁄28⁄90 / 2552-Re[3] default btns o-Dec90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.6 KB  |  52 lines  |  [TEXT/GEOL]

  1. Item    9059786                         27-Dec-90        03:23PST
  2.  
  3. From:   AUST0134                        Jam Software Sydney,IVR
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.         CSX.ACCOUNT1                    CSX Technology, Scott Steffan,PRT
  7.  
  8. ------------------------------------------------------------------------------
  9.  
  10. Sub:    Re[3] default btns on the fly
  11.  
  12. Thomas,
  13.  
  14. I have my dialogs automatically set up the default button adornment on opening
  15. with the following OVERRIDE.  Note the default button is left centred around
  16. its position as specified in the View.
  17. Of course you could add a method with the same sort of code to change the
  18. default button while the dialog was actually up and running.
  19. (My thanx to a link (I think it was from Curtis Faith?), which advocated this
  20. idea)
  21.  
  22. {==============================================
  23.            TAutoDialog
  24.    Automatically circles the default button
  25. ==============================================}
  26. PROCEDURE TAutoDialog.DoOpen; OVERRIDE;
  27. VAR
  28.    defaultView:TButton;
  29. BEGIN
  30.    IF LONGINT(fDefaultItem) <> LONGINT(kNoIdentifier) THEN BEGIN
  31.    defaultView := TButton(FindSubView(fDefaultItem));
  32.    IF (defaultView <> NIL) & (NOT (adnRRect IN defaultView.fAdornment)) THEN
  33. BEGIN
  34. {$PUSH} {$H-}
  35.    defaultView.fAdornment := [adnRRect];
  36.    SetRect(defaultView.fInset,4,4,4,4);
  37.    SetPt(defaultView.fPenSize,3,3);
  38.    WITH defaultView.fLocation DO
  39.    defaultView.Locate(h - 4, v - 4, kDontRedraw);
  40.    WITH defaultView.fSize DO
  41.    defaultView.Resize(h + 8, v + 8, kRedraw);
  42. {$POP}
  43.    END;
  44.    END;
  45.    INHERITED DoOpen;
  46. END;
  47.  
  48. Tseung Cheung
  49. JAM Software Pty Ltd
  50. ALink AUST0134
  51.  
  52.